<?php

/**
 * Introduction: 系统设置
 * @author: 杨陈鹏
 * @email: yangchenpeng@cdlinglu.com
 */


namespace Admin\Controller\Setting;


use Common\Controller\Admin\CommonController;

class IndexController extends CommonController
{

    /**
     * Introduction: 设置轮波涛
     * @author: 杨陈鹏
     * @email: yangchenpeng@cdlinglu.com
     */
    public function setSlide()
    {

        $data = I('post.data');
        $logic = D('Common/Setting','Logic');

        if ($data) {

            $this->ajaxReturn($logic::set('home_slide',$data,'移动的首页显示的商城名称',true));

        }



        $data = $logic::get('home_slide');

        $this->data = $data['data'];

        $this->display();



    }
    /**
     * Introduction: 设置商品名称
     * @author: 杨陈鹏
     * @email: yangchenpeng@cdlinglu.com
     */
    public function setName()
    {


        $data = I('post.data');

        $logic = D('Common/Setting','Logic');

        if (isset($data['name'])) {

            $data['name'] = trim($data['name']);

            $this->ajaxReturn($logic::set('market_name',$data,'移动的首页显示的商城名称',true));

        }

        $data = $logic::get('market_name');

        $this->data = $data['data'];

        $this->display();

    }
    /**
     * Introduction: 设置首页推荐分类
     * @author: 杨陈鹏
     * @email: yangchenpeng@cdlinglu.com
     */
    public function setCategory()
    {

        $data = I('post.data');

        $logic = D('Common/Setting','Logic');

        //$this->ajaxReturn($data);

        if ($data) {

            $this->ajaxReturn($logic::set('home_category',$data,'移动端首页推荐分类',true));

        }

        $data = $logic::get('home_category');

        $this->data = $data['data'];

        $this->display();

    }
    /**
     * Introduction: 设置首页分类下广告
     * @author: 杨陈鹏
     * @email: yangchenpeng@cdlinglu.com
     */
    public function setAd()
    {

        $data = I('post.data');

        $logic = D('Common/Setting','Logic');

        if ($data) {

            $this->ajaxReturn($logic::set('home_ad',$data,'移动端首页广告',true));

        }

        $data = $logic::get('home_ad');

        $this->data = $data['data'];

        $this->display();

    }
    /**
     * Introduction: 首页热门商品设置
     * @author: 杨陈鹏
     * @email: yangchenpeng@cdlinglu.com
     */
    public function hotGoods()
    {

        $data = I('post.data');

        $logic = D('Common/Setting','Logic');

        if ($data) {

            $this->ajaxReturn($logic::set('hot_goods',$data,'热门商品',true));

        }

        $data = $logic::get('hot_goods');

        $this->data = $data['data'];

        $this->display();

    }
    /**
     * Introduction: 首页热门专题设置
     * @author: 杨陈鹏
     * @email: yangchenpeng@cdlinglu.com
     */
    public function hotSpecial()
    {

        $data = I('post.data');

        $logic = D('Common/Setting','Logic');

        if ($data) {

            $this->ajaxReturn($logic::set('hot_special',$data,'热门专题',true));

        }

        $data = $logic::get('hot_special');

        $this->data = $data['data'];

        $this->display();

    }
    /**
     * Introduction: 首页热门活动设置
     * @author: 杨陈鹏
     * @email: yangchenpeng@cdlinglu.com
     */
    public function hotActivity()
    {

        $data = I('post.data');

        $logic = D('Common/Setting','Logic');

        if ($data) {

            $this->ajaxReturn($logic::set('hot_activity',$data,'热门专题',true));

        }

        $data = $logic::get('hot_activity');

        $this->data = $data['data'];

        $this->display();

    }

}